﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RT = Coolzon.Metadata.Runtime;

namespace Coolzon.WebServer.Code.Common
{
    public class ServerData
    {
        public static readonly string UniqueDomainId = "UniqueDomainId";
        public static bool IsUpdatingSolution = false;
        public static object S_DOMAINLISTLOCKOBJ = new object();

        private static object s_lockObj = new object();
        private static ServerData s_instance;

        public static ServerData Instance
        {
            get
            {
                if (s_instance == null)
                {
                    lock (s_lockObj)
                    {
                        if (s_instance == null)
                        {
                            s_instance = new ServerData();
                        }
                    }
                }
                return s_instance;
            }
        }

        private ServerData()
        {
            Libraries = new List<Web.Models.Library>();
        }

        /// <summary>
        /// 方案列表
        /// </summary>
        public List<RT.SolutionRef> SolutionList { get; set; }

        public List<RT.SolutionPackage> Solutions { get; set; }

        public List<Web.Models.Library> Libraries { get; set; }
    }
}
